package com.fancy.learncenter.common;

import android.app.Application;
import android.content.Context;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.fancy.learncenter.utils.LogUtil;
import com.fancy.learncenter.utils.ToastUtil;

import java.util.concurrent.TimeUnit;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLSession;

import okhttp3.OkHttpClient;

/**
 * Created by Hyy on 2016/9/22.
 */
public class MyApplication extends Application {

    public static Context context = null;


    private static MyApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();

        context = getApplicationContext();
        LogUtil.MyLog("cssss", "ccccccc" + getApplicationContext());
        ToastUtil.initToast(getApplicationContext());

//        //微信
//        PlatformConfig.setWeixin("wxd422caeaa8ad29c5", "3820b5f7985c8ba0a30c123f619d8262");
//        //新浪微博
//        PlatformConfig.setSinaWeibo("600049747", "04b48b094faeb16683c32669824ebdad");
//        //QQ
//        PlatformConfig.setQQZone("1105746474", "3inyZO7bl8nK9SaC");

        initFresco();
    }

    private void initFresco() {
        Fresco.initialize(this);
    }

    public Context getContext() {
        if (context == null) {
            
            LogUtil.MyLog("cssss", "getApplicationContextsss" + getApplicationContext());
            context = this.getApplicationContext();
        }

        LogUtil.MyLog("cssss", "ssssssss" + context);
        return context;
    }

    public static MyApplication getInstance() {

        if (instance == null) {
            instance = new MyApplication();
        }
        return instance;
    }

}
